package cn.tjjcy.service;

import cn.tjjcy.domain.RealGzConfEntity;
import cn.tjjcy.service.process.AbstractProcessService;
import cn.tjjcy.service.process.DefaultProcessService;
import cn.tjjcy.service.process.ScbgProcessService;
import cn.tjjcy.service.process.XwblProcessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class ProcessorSelector {


    @Autowired
    private DefaultProcessService defaultProcessService;

    @Autowired
    private XwblProcessService xwblProcessService;
    @Autowired
    private ScbgProcessService scbgProcessService;


    public AbstractProcessService selectProcess(RealGzConfEntity gzConf) {
        String gzProcessor = gzConf.getGzProcessor();
        if("XwblProcessService".equals(gzProcessor)){
            return xwblProcessService;
        }else if("ScbgProcessService".equals(gzProcessor)){
            return scbgProcessService;
        }
        return defaultProcessService;
    }

}
